package com.open.capacity.config;

import com.open.capacity.service.impl.SendMailService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "mailQ")
public class Listener {
    @Autowired
    private SendMailService sendMailService;

    @RabbitHandler
    public void process(String mail){
        sendMailService.sendMail(mail);
    }
}
